<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<h:head>
	<h:outputStylesheet library="css" name="principal.css"></h:outputStylesheet>

	<style type="text/css">
html, body {
	margin: 0px;
	padding: 0px;
	font-family: arial;
	font-size: 8pt;
	background: #f5f5f5;
}

#conteudo {
	padding: 20px;
	height: 350px;
}

.global .fc-event-skin {
	background: #006600 !important;
}

.pessoal .fc-event-skin {
	background: #003399 !important;
}
</style>

	<script type="text/javascript">
		PrimeFaces.locales['pt'] = {
			closeText : 'Fechar',
			prevText : 'Anterior',
			nextText : 'Próximo',
			currentText : 'Começo',
			monthNames : [ 'Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio',
					'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro',
					'Novembro', 'Dezembro' ],
			monthNamesShort : [ 'Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun',
					'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez' ],
			dayNames : [ 'Domingo', 'Segunda', 'Terça', 'Quarta', 'Quinta',
					'Sexta', 'Sábado' ],
			dayNamesShort : [ 'Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sáb' ],
			dayNamesMin : [ 'D', 'S', 'T', 'Q', 'Q', 'S', 'S' ],
			weekHeader : 'Semana',
			firstDay : 1,
			isRTL : false,
			showMonthAfterYear : false,
			yearSuffix : '',
			timeOnlyTitle : 'Só Horas',
			timeText : 'Tempo',
			hourText : 'Hora',
			minuteText : 'Minuto',
			secondText : 'Segundo',
			currentText : 'Data Atual',
			ampm : false,
			month : 'Mês',
			week : 'Semana',
			day : 'Dia',
			allDayText : 'Todo Dia'
		};
	</script>
</h:head>

<ui:composition template="_template.xhtml">

	<ui:define name="conteudo">
		<h:form>
			<p:growl id="messages" showDetail="true" />

			<h:panelGrid columnClasses="value" width="1000px">
				<p:schedule id="schedule" value="#{agendamentoBean.eventModel}"
					widgetVar="myschedule" timeZone="GMT+2">

					<p:ajax event="dateSelect" listener="#{agendamentoBean.onDateSelect}"
						update="eventDetails" oncomplete="PF('eventDialog').show();" />
					<p:ajax event="eventSelect"
						listener="#{agendamentoBean.onEventSelect}" update="eventDetails"
						oncomplete="PF('eventDialog').show();" />
					<p:ajax event="eventMove" listener="#{agendamentoBean.onEventMove}"
						update="messages" />
					<p:ajax event="eventResize"
						listener="#{agendamentoBean.onEventResize}" update="messages" />

				</p:schedule>

			</h:panelGrid>

			<p:dialog widgetVar="eventDialog" header="Event Details"
				showEffect="clip" hideEffect="clip">
				<h:panelGrid id="eventDetails" columns="2">
					<h:outputLabel for="descricao" value="Descrição:" />
					<p:inputText id="descricao" value="#{agendamentoBean.event.title}"
						required="true" />

					<h:outputLabel for="data" value="Data:" />
					<p:inputMask id="data" value="#{agendamentoBean.event.startDate}"
						mask="99/99/9999">
						<f:convertDateTime pattern="dd/MM/yyyy" timeZone="GMT+2" />
					</p:inputMask>

					<p:commandButton type="reset" value="Reset" />
					<p:commandButton id="addButton" value="Salvar"
						actionListener="#{agendamentoBean.addEvent}"
						oncomplete="PF('myschedule').update();PF('eventDialog').hide();" />
				</h:panelGrid>
			</p:dialog>
		</h:form>
	</ui:define>
</ui:composition>
</html>